package cn.csc.module.shop.api.detail;

import cn.csc.framework.common.pojo.CommonResult;
import cn.csc.module.shop.api.detail.dto.ShopDetailRelateReqDTO;
import cn.csc.module.shop.api.detail.dto.ShopDetailRespDTO;
import cn.csc.module.shop.api.detail.dto.UpdateShopTypeReqDTO;
import cn.csc.module.shop.enums.ApiConstants;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigInteger;
import java.util.List;

/**
 * 店铺详情 API 接口
 * Author: liuchuang
 * Date: 2024/1/13
 * Time: 09:36
 * Declaration: All Rights Reserved !!!
 */
@FeignClient(name = ApiConstants.NAME) // TODO fallbackFactory =
@Api(tags = "RPC 服务 - 店铺详情")
public interface ShopDetailApi {

    String PREFIX = ApiConstants.PREFIX + "/shop";

    @GetMapping(PREFIX + "/get")
    @ApiOperation("获得店铺详情")
    @ApiImplicitParam(name = "shopId", value = "店铺编号", required = true, example = "2048")
    CommonResult<ShopDetailRespDTO> getShopDetail(@RequestParam("shopId") BigInteger shopId);

    /**
     * 通过店铺编号列表获得店铺详情
     *
     * @param shopIds 店铺编号列表
     * @return 店铺详情list
     */
    @GetMapping(value = PREFIX + "/getShopDetailList")
    CommonResult<List<ShopDetailRespDTO>> getShopDetailList(@RequestParam("shopIds") List<BigInteger> shopIds);


    @GetMapping(PREFIX + "/relate")
    @ApiOperation("从华商贸关联店铺")
    CommonResult<Boolean> relateShopDetail(@RequestBody ShopDetailRelateReqDTO reqDTO);


    @PostMapping(PREFIX + "/updateShopType")
    @ApiOperation("更新店铺类型")
    CommonResult<Boolean> updateShopType(@RequestBody UpdateShopTypeReqDTO reqDTO);




}
